import { ModuleWithProviders, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule } from '@angular/router';

// third libs
import { FormlyModule } from '@ngx-formly/core';
import { ApesPanelModule } from '@shared/apes/panel';
import { AddPanelModule } from '../routes/e-commerce/adminPanel/addPanel/addPanel.module';

// i18n
import { TranslateModule } from '@ngx-translate/core';
// region: zorro modules


// grid
import { AgGridModule } from '@ag-grid-community/angular';

import { ApesModule } from './apes/apes.module';
import { ApesDialogModule } from './dialog';
import { ApesDialogTransferModule } from './dialog-transfer';
import { ApesOaModule } from './apes-oa';
import { ApesLoginModule } from './apes-login';
import { ApesInputFormModule } from '@shared/apes-input-form';
import { ContextMenuModule } from '@shared/ag-grid-ext/context-menu/context-menu.module';
import { EpcModule } from '@shared/epc/epc.module';
import { DialogInquiryModule } from './dialog-inquiry';
import { ApesUploadDialogModule } from '@shared/ag-grid-ext/upload-component/apes-uploadDialog.module';
import { ApesDialogCascaderModule } from '@shared/dialog-cascader/apes-dialog-cascader.module';
import { CadModule } from '@shared/cad/cad.module';
import { DrawerInquiryModule } from '@shared/drawer-inquiry';
import { DrawerVehicleMasterControlModule } from '@shared/drawer-vehicleMasterControl';
import { DialogExpressionModule } from '@shared/dialog-expression';
import { DialogCarControlModule } from '@shared/dialog-carControl';
import { DialogPriceAdvanceModule } from '@shared/dialog-price-advance';
import { ApesNgSelectModule } from '@shared/apes-secondary-package/apes-ng-select/apes-ng-select.module';
import { ApesUploadImagesModule } from '@shared/apes-secondary-package/apes-upload-images/apes-upload-images.module';
import { DialogMakeInquiryModule } from '@shared/dialog-make-inquiry';


@NgModule({
  declarations: [],
  imports: [
    CommonModule,
    FormsModule,
    RouterModule,
    ReactiveFormsModule,
    HttpClientModule,
    ApesModule.forRoot(),
    // dynamicForm
    AddPanelModule,
    FormlyModule.forRoot(),
    AgGridModule.withComponents([]),
    ContextMenuModule,
  ],
  exports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule,

    // i18n
    TranslateModule,
    // dynamicform
    FormlyModule,
    AgGridModule,
    ApesModule,
    ApesDialogModule,
    ApesUploadDialogModule,
    DialogInquiryModule,
    DialogMakeInquiryModule,
    DialogPriceAdvanceModule,
    DialogExpressionModule,
    DrawerInquiryModule,
    DialogCarControlModule,
    DrawerVehicleMasterControlModule,
    ApesDialogTransferModule,
    ApesDialogCascaderModule,
    ApesOaModule,
    ApesPanelModule,
    ApesInputFormModule,
    ApesLoginModule,
    ContextMenuModule,
    EpcModule,
    CadModule,
    ApesNgSelectModule,
    ApesUploadImagesModule,
  ],
})
export class SharedModule {
  static forRoot(): ModuleWithProviders {
    return {
      ngModule: SharedModule,
    };
  }
}
